package com.gametheoryserver.gui.sum.state;

import com.gametheoryserver.gui.sum.action.HideStrategyAction;
import com.gametheoryserver.gui.sum.PlaySumGame;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;

/**
 * @author Tomas Barak
 * 
 */
public class ShowStrategyState implements ISumGameState {

	@Override
	public void refreshGame(PlaySumGame playSum) {
		for (HorizontalLayout h : playSum.getSumGame().getStrategyLayoutList()) {
			h.getComponent(1).setVisible(true);
		}
		for (Label l : playSum.getSumGame().getStrategies()) {
			l.setVisible(true);
		}
		playSum.getSumGame().getSumLabel().setVisible(true);
		playSum.getShowStrategyBtn().setCaption("Schovej strategii");
		playSum.getShowStrategyBtn().addListener(new HideStrategyAction(playSum));
	}

}
